home *** CD-ROM | disk | FTP | other *** search
- Program ColorBoxes_by_Neal_Trautman;
-
- uses Memtypes,QuickDraw,OSIntf,ToolIntf;
-
- Var rct : Rect;
- i,l,t,r,b,ww,wh : Integer;
-
- function randomize(x : integer) : integer;
- var x2 : longint;
- begin
- x2 := abs(random);
- randomize := (x2 * x) div 32768;
- end;
-
- begin
- ww := 512;
- wh := 342;
- repeat
- l := randomize(ww);
- t := randomize(wh);
- r := randomize (ww);
- b := randomize(wh);
- setrect(rct,l,t,r,b);
- i := randomize(20);
- if i < 10 then
- begin
- case i of
- 1 : forecolor(whitecolor);
- 2 : forecolor(redcolor);
- 3 : forecolor(greencolor);
- 4 : forecolor(bluecolor);
- 5 : forecolor(cyancolor);
- 6 : forecolor(magentacolor);
- 7 : forecolor(yellowcolor);
- otherwise forecolor(blackcolor);
- end;
- paintrect(rct);
- end
- else invertrect(rct);
- until button;
- end.
-
-